﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace tsgl
{
    public partial class selectBorrower : Form
    {
        public selectBorrower()
        {
            InitializeComponent();
        }

        public DataTable dt;
        public string getBorrowerId()
        {
            return label1.Text.Trim();
        }

        private void selectBorrower_Load(object sender, EventArgs e)
        {
            dt = bookDbClass.ExecuteDataTable("select 借阅者编号,姓名,借阅者类型,借书证状态,最大借书数量,最长借书期限,押金剩余,借书证状态 from borrowerView where 借书证状态='有效'");
            this.dataGridView1.DataSource = dt.DefaultView;
            label1.Visible = true;
            label1.DataBindings.Clear();
            label1.DataBindings.Add("text", dt.DefaultView, "借阅者编号");
            label1.Visible = false;
        }

        private void dataGridView1_DoubleClick(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Yes;
        }
    }
}